package com.alibaba.dubbo.common.configure;

import java.util.Collections;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;


public abstract class ExtensionConfiguratorImpl implements ExtensionConfigurator {
	private Map<String, Object> values = new ConcurrentHashMap<String, Object>();
	@Override
	public Object getValue(String name) {
		return values.get(name);
	}

	@Override
	public void setValue(String name, Object value) {
		values.put(name, value);
	}

	@Override
	public boolean containsValue(String name) {
		return values.containsKey(name);
	}

	@Override
	public Map<String, Object> getValues() {
		return Collections.unmodifiableMap(values);
	}

	@Override
	public void setValues(Map<String, Object> values) {
		if(values != null && !values.isEmpty()){
			for(Map.Entry<String, Object> entry : values.entrySet()){
				this.values.put(entry.getKey(), entry.getValue());
			}
		}
	}

	public ExtensionConfiguratorImpl() {
		super();
	}
	
	
}
